
*****************THIS CODE CREATES FIGURE 1 IN THE MAIN TEXT **************

*set working directory where the "Combined105-116_HRC" data file is saved
*use "Combined105-116_HRC.dta"

tabstat hrc if democrat==1, stats(mean sd) by(congress) 
tabstat congress if LGBLegislator==1,  stats(min max) by(lname)

gen fullname= fname + " " + lname
gen name_stateab= fullname + " (" + stateab + ")"

**note we do not list the district in this figure because district numbers change over time**
graph dot (min) congress (max) congress if LGBLegislator==1, over(name_stateab) ylabel(104(1)116)  exclude0 leg(off) marker(1, msymbol(D) mcolor(green)) marker(2, mcolor(red))

clear


********THIS CODE REPLICATES THE EMPIRICAL RESULTS DISPLAYED IN FIGURE 2 OF THE TEXT **************


/*

*use "Combined105-116_HRC.dta", replace

**Install CEM package
** ssc install cem, replace

**Install ESTOUT package
** ssc install estout, replace
 
Coarsening Choices
for nominate_d1 I have coarsened the data into four bins based on t25th, 50th and 75th percentile for each Cngress. 

*/


**105th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==105 & district>0
imb nominate_d1  Demvoteshare democrat if congress==105 & district>0, tr(LGBLegislator)
cem nominate_d1 (-0.35 .17 0.39)  Demvoteshare(30 45 55 70) democrat if congress==105 & district>0 , tr(LGBLegislator)
gen T105=LGBLegislator
label variable T105 "105th Congress"
eststo cong105: reg hrc T105 nominate_d1  Demvoteshare  [iweight=cem_weights] if congress==105 & district>0 , robust
outreg2 using H1all.xls, replace title("Effect of LGB Legislator") ///
label ctitle("105th Congress ")
rename (cem*) (_105_cem*)


**106th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==106 & district>0
imb nominate_d1   urban Demvoteshare democrat if congress==106 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.35 .14 0.39)   urban(5) Demvoteshare(30 45 55 70) democrat  if congress==106 & district>0, tr(LGBLegislator)
gen T106=LGBLegislator
label variable T106 "106th Congress"
eststo cong106: reg hrc T106 nominate_d1   urban Demvoteshare democrat [iweight=cem_weights] if congress==106 & district>0, robust
outreg2 using  H1all.xls, append title("Effect of LGB Legislator") ///
label ctitle("106th Congress ")
rename (cem*) (_106_cem*)

**107th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==107 & district>0
imb nominate_d1   urban Demvoteshare democrat if congress==107 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.36 .11 0.40)   urban(5) Demvoteshare(30 45 55 70) democrat if congress==107 & district>0, tr(LGBLegislator)
gen T107=LGBLegislator
label variable T107 "107th Congress"
eststo cong107: reg  hrc T107 nominate_d1   Demvoteshare urban democrat [iweight=cem_weights] if congress==107 & district>0, robust
outreg2 using  H1all.xls, append title("Effect of LGB Legislator") ///
label ctitle("107th Congress ")
rename (cem*) (_107_cem*)
///


**108th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==108 & district>0
imb nominate_d1   urban Demvoteshare democrat if congress==108 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.36 .18 0.40)   urban(5) Demvoteshare(30 45 55 70) democrat if congress==108 & district>0, tr(LGBLegislator)
gen T108=LGBLegislator
label variable T108 "108th Congress"
eststo cong108: reg hrc T108 nominate_d1   Demvoteshare urban democrat [iweight=cem_weights] if congress==108 & district>0, robust
estimates store cong108
outreg2 using  H1all.xls, append  ///
label ctitle("108th Congress ")
rename (cem*) (_108_cem*)
///

**109th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==109 & district>0
imb nominate_d1 urban Demvoteshare LGBHousehold democrat if congress==109 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.36 .22 0.41) LGBHousehold  urban(5) Demvoteshare(30 45 55 70) democrat if congress==109 & district>0, tr(LGBLegislator)
gen T109=LGBLegislator
label variable T109 "109th Congress"
eststo cong109: reg hrc T109 nominate_d1  LGBHousehold Demvoteshare urban democrat [iweight=cem_weights] if congress==109 & district>0, robust
outreg2 using  H1all.xls, append ///
label ctitle("109th Congress ")
rename (cem*) (_109_cem*)
///

**110th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==110 & district>0
imb nominate_d1 urban Demvoteshare LGBHousehold democrat if congress==110 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.36 -.15 0.4) LGBHousehold   urban(5) Demvoteshare(30 45 55 70) democrat  if congress==110 & district>0, tr(LGBLegislator)
gen T110=LGBLegislator
label variable T110 "110th Congress"
eststo cong110: reg hrc T110 nominate_d1 LGBHousehold Demvoteshare urban democrat [iweight=cem_weights] if congress==110 & district>0, robust
outreg2 using  H1all.xls, append ///
label ctitle("110th Congress ") 
rename (cem*) (_110_cem*)
///

**111th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==111 & district>0
imb nominate_d1 urban LGBHousehold  Demvoteshare democrat if congress==111 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.36 -.18 0.4) LGBHousehold  urban(5) Demvoteshare(30 45 55 70) democrat if congress==111 & district>0, tr(LGBLegislator)
gen T111=LGBLegislator
label variable T111 "111th Congress"
eststo cong111:reg hrc T111 nominate_d1 LGBHousehold  Demvoteshare urban democrat [iweight=cem_weights] if congress==111 & district>0, robust
outreg2 using  H1all.xls, append ///
label ctitle("111th Congress ") 
rename (cem*) (_111_cem*)
///


**112th Congress, adjust matching variables based on data availability ()
table LGBLegislator if congress==112 & district>0
imb nominate_d1   urban democrat LGBHousehold if congress==112 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.37 .22 0.49) LGBHousehold   urban(5) democrat if congress==112 & district>0, tr(LGBLegislator)
gen T112=LGBLegislator
label variable T112 "112th Congress"
eststo cong112: reg hrc T112 nominate_d1 LGBHousehold  urban democrat [iweight=cem_weights] if congress==112 & district>0, robust
outreg2 using  H1all.xls, append ///
label ctitle("112th Congress ") 
rename (cem*) (_112_cem*)
///


**113th Congress, adjust matching variables based on data availability

table LGBLegislator if congress==113 & district>0
imb nominate_d1   urban Demvoteshare LGBHousehold democrat if congress==113 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.37 .22 0.49) LGBHousehold  urban Demvoteshare(30 45 55 70) democrat  if congress==113 & district>0, tr(LGBLegislator)
gen T113=LGBLegislator
label variable T113 "113th Congress"
eststo cong113: reg hrc T113 nominate_d1 LGBHousehold Demvoteshare urban democrat [iweight=cem_weights] if congress==113 & district>0, robust
outreg2 using  H1all.xls, append ///
label ctitle("113th Congress ") 
rename (cem*) (_113_cem*)
///


**114th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==114 & district>0
imb nominate_d1   urban Demvoteshare LGBHousehold democrat if congress==114 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.37 .28 0.51) LGBHousehold urban(40 80) Demvoteshare(30 45 55 70) democrat  if congress==114 & district>0, tr(LGBLegislator)
gen T114=LGBLegislator
label variable T114 "114th Congress"
eststo cong114: reg hrc T114 nominate_d1  LGBHousehold Demvoteshare urban democrat [iweight=cem_weights] if congress==114 & district>0, robust
outreg2 using  H1all.xls, append ///
label ctitle("114th Congress ") 
rename (cem*) (_114_cem*)
///

**115th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==115 & district>0
imb nominate_d1 urban Demvoteshare LGBHousehold democrat if congress==115 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.37 .27 0.51) urban(40 80) LGBHousehold Demvoteshare(30 45 55 70) democrat  if congress==115 & district>0, tr(LGBLegislator)
gen T115=LGBLegislator
label variable T115 "115th Congress"
eststo cong115: reg hrc T115 nominate_d1 LGBHousehold Demvoteshare urban democrat [iweight=cem_weights] if congress==115 & district>0, robust
outreg2 using  H1all.xls, append ///
label ctitle("115th Congress") 
rename (cem*) (_115_cem*)
///

**116th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==116 & district>0
imb nominate_d1   urban Demvoteshare LGBHousehold democrat if congress==116 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.37 -.16 0.48) LGBHousehold  urban Demvoteshare(30 45 55 70) democrat if congress==116 & district>0, tr(LGBLegislator) 
label variable LGBLegislator cong116
gen T116=LGBLegislator
label variable T116 "116th Congress"
gen imb_match__116=r(L1)
eststo cong116: reg hrc T116 nominate_d1 LGBHousehold Demvoteshare urban democrat [iweight=cem_weights] if congress==116 & district>0, robust
estimates store cong116
outreg2 using  H1all.xls, append ///
label ctitle("116th Congress ")
rename (cem*) (_116_cem*)
///



**All Congresses except 105th and 112th so we can match on the full set of variables
quietly tabulate congress, generate(new_congress)
table LGBLegislator if congress~=105 & congress~=112 & district>0
imb nominate_d1   urban Demvoteshare democrat congress if congress~=105 & congress~=112 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.36 0.16 0.43)   urban Demvoteshare(30 45 55 70) democrat congress if congress~=105 & congress~=112  & district>0, tr(LGBLegislator) 
gen TAll=LGBLegislator
label variable TAll "All Congresses"
eststo AllCongress: reg hrc TAll nominate_d1 Demvoteshare urban democrat  i.congress [iweight=cem_weights] if congress~=105 & congress~=112 & district>0, robust
outreg2 using  H1all.xls, append ///
label ctitle("All Congresses ") 
rename (cem*) (all_cong_cem*)
///


**All Congresses, exclude 105-108 b/c no data on LGBHousehold and 112th missing voteshare data
table LGBLegislator if congress<109  & congress~=112 & district>0
imb nominate_d1   urban Demvoteshare democrat congress LGBHousehold if congress>108 & congress~=112 & district>0, tr(LGBLegislator)
cem nominate_d1(-0.36 0.16 0.43)   urban Demvoteshare(30 45 55 70) LGBHousehold democrat congress if congress> 108 & congress~=112  & district>0, tr(LGBLegislator) 
gen TAllLGB=LGBLegislator
label variable TAllLGB "AllCongressLGB"
eststo AllCongressLGB: reg hrc TAllLGB nominate_d1 Demvoteshare urban democrat LGBHousehold i.congress [iweight=cem_weights] if congress>108 & congress~=112 & district>0, robust
outreg2 using  H1all.xls, append ///
label ctitle("All Congresses w/ LGB Household") 
rename (cem*) (all_cong_LGB_cem*)
///


coefplot cong105  cong106 cong107 cong108 cong109 cong110 cong111 cong112 cong113  cong114 cong115 cong116 AllCongress AllCongressLGB, keep(T105 T106 T107 T108 T109 T110 T111 T112 T113 T114 T115 T116 TAll TAllLGB) scheme(s1mono) xline(0) level(90) legend(off) xtitle(Estimated Coefficients for All LGB Legislators)

/*Identify matched LGB legislators for each congress
list lname fname democrat congress _105_cem_matched if LGBLegislator==1 & _105_cem_matched~=.
list lname fname democrat congress _106_cem_matched if LGBLegislator==1 & _106_cem_matched~=.
list lname fname democrat congress _107_cem_matched if LGBLegislator==1 & _107_cem_matched~=.
list lname fname democrat congress _108_cem_matched if LGBLegislator==1 & _108_cem_matched~=.
list lname fname democrat congress _109_cem_matched if LGBLegislator==1 & _109_cem_matched~=.
list lname fname democrat congress _110_cem_matched if LGBLegislator==1 & _110_cem_matched~=.
list lname fname democrat congress _111_cem_matched if LGBLegislator==1 & _111_cem_matched~=.
list lname fname democrat congress _112_cem_matched if LGBLegislator==1 & _112_cem_matched~=.
list lname fname democrat congress _113_cem_matched if LGBLegislator==1 & _113_cem_matched~=.
list lname fname democrat congress _114_cem_matched if LGBLegislator==1 & _114_cem_matched~=.
list lname fname democrat congress _115_cem_matched if LGBLegislator==1 & _115_cem_matched~=.
list lname fname democrat congress _116_cem_matched if LGBLegislator==1 & _116_cem_matched~=.
list lname fname democrat congress all_cong_cem_matched if LGBLegislator==1 & all_cong_cem_matched~=.
list lname fname democrat congress all_cong_LGB_cem_matched if LGBLegislator==1 & all_cong_LGB_cem_matched~=.


**Count number of non-LGB legislators matched for each congress
sort congress
sum congress  if LGBLegislator==0 & _105_cem_matched==1
sum congress  if LGBLegislator==0 & _106_cem_matched==1
sum congress  if LGBLegislator==0 & _107_cem_matched==1
sum congress  if LGBLegislator==0 & _108_cem_matched==1
sum congress  if LGBLegislator==0 & _109_cem_matched==1
sum congress  if LGBLegislator==0 & _110_cem_matched==1
sum congress  if LGBLegislator==0 & _111_cem_matched==1
sum congress  if LGBLegislator==0 & _112_cem_matched==1
sum congress  if LGBLegislator==0 & _113_cem_matched==1
sum congress  if LGBLegislator==0 & _114_cem_matched==1
sum congress  if LGBLegislator==0 & _115_cem_matched==1
sum congress  if LGBLegislator==0 & _116_cem_matched==1
sum congress  if LGBLegislator==0 & all_cong_cem_matched==1
sum congress  if LGBLegislator==0 & all_cong_LGB_cem_matched==1

*/

clear
 

**********  THE CODE BELOW CREATES THE "DEMOCRATS ONLY" PORTION OF FIGURE 2 *********************

*use "Combined105-116_HRC.dta", replace

drop if  democrat==0

**105th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==105  
imb nominate_d1  Demvoteshare   if congress==105  , tr(LGBLegislator)
cem nominate_d1 (-0.35 .17 0.39)  Demvoteshare(30 45 55 70)   if congress==105 , tr(LGBLegislator)
gen T105=LGBLegislator
label variable T105 "105th Congress"
eststo cong105: reg hrc T105 nominate_d1  Demvoteshare  [iweight=cem_weights] if congress==105, robust
estimate store cong105
outreg2 using H1Dems.xls, replace title("Effect of LGB Legislator") ///
label ctitle("105th Congress ")
rename (cem*) (_105_cem*)


**106th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==106  
imb nominate_d1   urban Demvoteshare   if congress==106  , tr(LGBLegislator)
cem nominate_d1(-0.35 .14 0.39)   urban(5) Demvoteshare(30 45 55 70)    if congress==106, tr(LGBLegislator)
gen T106=LGBLegislator
label variable T106 "106th Congress"
eststo cong106: reg hrc T106 nominate_d1   urban Demvoteshare   [iweight=cem_weights] if congress==106, robust
outreg2 using  H1Dems.xls, append title("Effect of LGB Legislator") ///
label ctitle("106th Congress ")
rename (cem*) (_106_cem*)

**107th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==107  
imb nominate_d1   urban Demvoteshare   if congress==107  , tr(LGBLegislator)
cem nominate_d1(-0.36 .11 0.40)   urban(5) Demvoteshare(30 45 55 70)   if congress==107, tr(LGBLegislator)
gen T107=LGBLegislator
label variable T107 "107th Congress"
eststo cong107: reg  hrc T107 nominate_d1   Demvoteshare urban   [iweight=cem_weights] if congress==107, robust
outreg2 using  H1Dems.xls, append title("Effect of LGB Legislator") ///
label ctitle("107th Congress ")
rename (cem*) (_107_cem*)
///


**108th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==108  
imb nominate_d1   urban Demvoteshare   if congress==108  , tr(LGBLegislator)
cem nominate_d1(-0.36 .18 0.40)   urban(5) Demvoteshare(30 45 55 70)   if congress==108, tr(LGBLegislator)
gen T108=LGBLegislator
label variable T108 "108th Congress"
eststo cong108: reg hrc T108 nominate_d1   Demvoteshare urban   [iweight=cem_weights] if congress==108, robust
estimates store cong108
outreg2 using  H1Dems.xls, append  ///
label ctitle("108th Congress ")
rename (cem*) (_108_cem*)
///

**109th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==109  
imb nominate_d1 urban Demvoteshare LGBHousehold   if congress==109  , tr(LGBLegislator)
cem nominate_d1(-0.36 .22 0.41) LGBHousehold  urban(5) Demvoteshare(30 45 55 70)   if congress==109, tr(LGBLegislator)
gen T109=LGBLegislator
label variable T109 "109th Congress"
eststo cong109: reg hrc T109 nominate_d1  LGBHousehold Demvoteshare urban   [iweight=cem_weights] if congress==109, robust
outreg2 using  H1Dems.xls, append ///
label ctitle("109th Congress ")
rename (cem*) (_109_cem*)
///

**110th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==110  
imb nominate_d1 urban Demvoteshare LGBHousehold   if congress==110  , tr(LGBLegislator)
cem nominate_d1(-0.36 -.15 0.4) LGBHousehold   urban(5) Demvoteshare(30 45 55 70)    if congress==110  , tr(LGBLegislator)
gen T110=LGBLegislator
label variable T110 "110th Congress"
eststo cong110: reg hrc T110 nominate_d1 LGBHousehold Demvoteshare urban   [iweight=cem_weights] if congress==110  , robust
outreg2 using  H1Dems.xls, append ///
label ctitle("110th Congress ") 
rename (cem*) (_110_cem*)
///

**111th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==111  
imb nominate_d1 urban LGBHousehold  Demvoteshare   if congress==111  , tr(LGBLegislator)
cem nominate_d1(-0.36 -.18 0.4) LGBHousehold  urban(5) Demvoteshare(30 45 55 70)   if congress==111  , tr(LGBLegislator)
gen T111=LGBLegislator
label variable T111 "111th Congress"
eststo cong111:reg hrc T111 nominate_d1 LGBHousehold  Demvoteshare urban   [iweight=cem_weights] if congress==111  , robust
outreg2 using  H1Dems.xls, append ///
label ctitle("111th Congress ") 
rename (cem*) (_111_cem*)
///


**112th Congress, adjust matching variables based on data availability ()
table LGBLegislator if congress==112  
imb nominate_d1   urban   LGBHousehold if congress==112  , tr(LGBLegislator)
cem nominate_d1(-0.37 .22 0.49) LGBHousehold   urban(5)   if congress==112  , tr(LGBLegislator)
gen T112=LGBLegislator
label variable T112 "112th Congress"
eststo cong112: reg hrc T112 nominate_d1 LGBHousehold  urban   [iweight=cem_weights] if congress==112  , robust
outreg2 using  H1Dems.xls, append ///
label ctitle("112th Congress ") 
rename (cem*) (_112_cem*)
///


**113th Congress, adjust matching variables based on data availability

table LGBLegislator if congress==113  
imb nominate_d1   urban Demvoteshare LGBHousehold   if congress==113  , tr(LGBLegislator)
cem nominate_d1(-0.37 .22 0.49) LGBHousehold  urban Demvoteshare(30 45 55 70) if congress==113  , tr(LGBLegislator)
gen T113=LGBLegislator
label variable T113 "113th Congress"
eststo cong113: reg hrc T113 nominate_d1 LGBHousehold Demvoteshare urban   [iweight=cem_weights] if congress==113  , robust
outreg2 using  H1Dems.xls, append ///
label ctitle("113th Congress ") 
rename (cem*) (_113_cem*)
///


**114th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==114  
imb nominate_d1   urban Demvoteshare LGBHousehold   if congress==114  , tr(LGBLegislator)
cem nominate_d1(-0.37 .28 0.51) LGBHousehold urban(40 80) Demvoteshare(30 45 55 70)    if congress==114  , tr(LGBLegislator)
gen T114=LGBLegislator
label variable T114 "114th Congress"
eststo cong114: reg hrc T114 nominate_d1  LGBHousehold Demvoteshare urban   [iweight=cem_weights] if congress==114  , robust
outreg2 using  H1Dems.xls, append ///
label ctitle("114th Congress ") 
rename (cem*) (_114_cem*)
///

**115th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==115  
imb nominate_d1 urban Demvoteshare LGBHousehold   if congress==115  , tr(LGBLegislator)
cem nominate_d1(-0.37 .27 0.51) urban(40 80) LGBHousehold Demvoteshare(30 45 55 70)    if congress==115  , tr(LGBLegislator)
gen T115=LGBLegislator
label variable T115 "115th Congress"
eststo cong115: reg hrc T115 nominate_d1 LGBHousehold Demvoteshare urban   [iweight=cem_weights] if congress==115  , robust
outreg2 using  H1Dems.xls, append ///
label ctitle("115th Congress") 
rename (cem*) (_115_cem*)
///

**116th Congress, adjust matching variables based on data availability
table LGBLegislator if congress==116  
imb nominate_d1   urban Demvoteshare LGBHousehold   if congress==116  , tr(LGBLegislator)
cem nominate_d1(-0.37 -.16 0.48) LGBHousehold  urban Demvoteshare(30 45 55 70)   if congress==116  , tr(LGBLegislator) 
label variable LGBLegislator cong116
gen T116=LGBLegislator
label variable T116 "116th Congress"
gen imb_match__116=r(L1)
eststo cong116: reg hrc T116 nominate_d1 LGBHousehold Demvoteshare urban   [iweight=cem_weights] if congress==116  , robust
estimates store cong116
outreg2 using  H1Dems.xls, append ///
label ctitle("116th Congress ")
rename (cem*) (_116_cem*)
///


**All Congresses except 105th and 112th so we can match on the full set of variables

**All Congresses except 105th and 112th so we can match on the full set of variables
quietly tabulate congress, generate(new_congress)
table LGBLegislator if congress~=105 & congress~=112  
imb nominate_d1   urban Demvoteshare democrat congress if congress~=105 & congress~=112  , tr(LGBLegislator)
cem nominate_d1(-0.36 0.16 0.43)   urban Demvoteshare(30 45 55 70) democrat congress if congress~=105 & congress~=112   , tr(LGBLegislator) 
gen TAll=LGBLegislator
label variable TAll "All Congresses"
eststo AllCongress: reg hrc TAll nominate_d1 Demvoteshare urban democrat  i.congress [iweight=cem_weights] if congress~=105 & congress~=112  , robust
outreg2 using  H1Dems.xls, append ///
label ctitle("All Congresses ") 
rename (cem*) (all_cong_cem*)
///


**All Congresses, exclude 105-108 b/c no data on LGBHousehold and 112th missing voteshare data
table LGBLegislator if congress<109  & congress~=112  
imb nominate_d1   urban Demvoteshare democrat congress LGBHousehold if congress>108 & congress~=112  , tr(LGBLegislator)
cem nominate_d1(-0.36 0.16 0.43)   urban Demvoteshare(30 45 55 70) LGBHousehold democrat congress if congress> 108 & congress~=112   , tr(LGBLegislator) 
gen TAllLGB=LGBLegislator
label variable TAllLGB "AllCongressLGB"
eststo AllCongressLGB: reg hrc TAllLGB nominate_d1 Demvoteshare urban democrat LGBHousehold i.congress [iweight=cem_weights] if congress>108 & congress~=112  , robust
outreg2 using  H1Dems.xls, append ///
label ctitle("All Congresses w/ LGB Household") 
rename (cem*) (all_cong_LGB_cem*)
///


coefplot cong105  cong106 cong107 cong108 cong109 cong110 cong111 cong112 cong113  cong114 cong115 cong116 AllCongress AllCongressLGB, keep(T105 T106 T107 T108 T109 T110 T111 T112 T113 T114 T115 T116 TAll TAllLGB) scheme(s1mono) xline(0) level(90) legend(off) xtitle(Estimates for Democratic LGB Legislators)

/**Identify matched LGB legislators for each congress

list lname fname democrat congress _105_cem_matched if LGBLegislator==1 & _105_cem_matched~=.
list lname fname democrat congress _106_cem_matched if LGBLegislator==1 & _106_cem_matched~=.
list lname fname democrat congress _107_cem_matched if LGBLegislator==1 & _107_cem_matched~=.
list lname fname democrat congress _108_cem_matched if LGBLegislator==1 & _108_cem_matched~=.
list lname fname democrat congress _109_cem_matched if LGBLegislator==1 & _109_cem_matched~=.
list lname fname democrat congress _110_cem_matched if LGBLegislator==1 & _110_cem_matched~=.
list lname fname democrat congress _111_cem_matched if LGBLegislator==1 & _111_cem_matched~=.
list lname fname democrat congress _112_cem_matched if LGBLegislator==1 & _112_cem_matched~=.
list lname fname democrat congress _113_cem_matched if LGBLegislator==1 & _113_cem_matched~=.
list lname fname democrat congress _114_cem_matched if LGBLegislator==1 & _114_cem_matched~=.
list lname fname democrat congress _115_cem_matched if LGBLegislator==1 & _115_cem_matched~=.
list lname fname democrat congress _116_cem_matched if LGBLegislator==1 & _116_cem_matched~=.
list lname fname democrat congress all_cong_cem_matched if LGBLegislator==1 & all_cong_cem_matched~=.
list lname fname democrat congress all_cong_LGB_cem_matched if LGBLegislator==1 & all_cong_LGB_cem_matched~=.


**Count number of non-LGB legislators matched for each congress
sort congress
sum congress  if LGBLegislator==0 & _105_cem_matched==1
sum congress  if LGBLegislator==0 & _106_cem_matched==1
sum congress  if LGBLegislator==0 & _107_cem_matched==1
sum congress  if LGBLegislator==0 & _108_cem_matched==1
sum congress  if LGBLegislator==0 & _109_cem_matched==1
sum congress  if LGBLegislator==0 & _110_cem_matched==1
sum congress  if LGBLegislator==0 & _111_cem_matched==1
sum congress  if LGBLegislator==0 & _112_cem_matched==1
sum congress  if LGBLegislator==0 & _113_cem_matched==1
sum congress  if LGBLegislator==0 & _114_cem_matched==1
sum congress  if LGBLegislator==0 & _115_cem_matched==1
sum congress  if LGBLegislator==0 & _116_cem_matched==1
sum congress  if LGBLegislator==0 & all_cong_cem_matched==1
sum congress  if LGBLegislator==0 & all_cong_LGB_cem_matched==1
 */


clear





